package com.liu.test;

import com.liu.rabbitmq.RabbitMqApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * C测试分列模式
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = RabbitMqApplication.class)
public class ProducerTest2 {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    @Test
   public void sendMsg() throws InterruptedException {
       for (int i = 0;i<3;i++){
           //Thread.sleep(100);
           rabbitTemplate.convertAndSend("dahai",null,"rabbitmq hello world!"+i);
       }


   }



}
